import React from 'react'

import { addN } from './redux/actions'
// import { useUpdate } from './utils/useRedux'
import { useSelector, useDispatch } from 'react-redux'
export default function Demo() {
  // useUpdate()
  const c = useSelector((state) => {
    return state.c
  })
  const dispatch = useDispatch()
  return (
    <div>
      <p>{c}</p>
      <button
        onClick={() => {
          dispatch(addN(6))
        }}
      >
        +6
      </button>
      <button
        onClick={() => {
          dispatch(addN(8))
        }}
      >
        +8
      </button>
    </div>
  )
}
